package io.kiki.sba.registry.store.jdbc.mapper;

import io.kiki.sba.registry.store.jdbc.domain.AppRevisionDomain;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Set;


public interface AppRevisionMapper {


    List<AppRevisionDomain> queryRevision(@Param("dataCenters") Set<String> dataCenters, @Param("revision") String revision);

    List<AppRevisionDomain> listRevisions(@Param("dataCenter") String dataCenter, @Param("afterId") long afterId, @Param("limit") int limit);

    int heartbeat(@Param("dataCenter") String dataCenter, @Param("revision") String revision);

    void replace(AppRevisionDomain domain);

    List<AppRevisionDomain> getExpired(@Param("dataCenter") String dataCenter, @Param("beforeTime") Date beforeTime, @Param("limit") int limit);

    int cleanDeleted(@Param("dataCenter") String dataCenter, @Param("beforeTime") Date beforeTime, @Param("limit") int limit);
}
